import requestSecurity from "/src/components/node-kantboot/libs/requestSecurity";
import storage from "/src/components/node-kantboot/libs/storage";

/**
 * 获取人才计划列表
 */
let requestSelf = ()=> {
    // 获取用户自身信息
    return new Promise((resolve, reject) => {
        requestSecurity.send({
            // 检测到未登录，不自动跳转登录页
            isJumpLogin:false,
            uri: "/user-account-web/userAccount/getSelf",
            stateSuccess: (res) => {
                console.debug("获取用户自身信息成功", res);
                // 保存用户信息到缓存
                storage.set("userAccount:self", res.data);
                resolve(res);
            },
            stateFail: (res) => {
                console.debug("获取用户自身信息失败", res);
                reject(res);
            }
        })
    });
}


export default {
    requestSelf
}